#[macro_use]
extern crate r_ui;
// use r_ui::View;
use r_ui::view::UI;
use r_ui::utils::ToFils;

// pub fn app_with<'a, F>(html: &view::UI, res_files:Vec<&str>, how_handle: F)
// where
//     F: Fn(view::S<String>, view::R<String>) + Send + 'static,
// {
//     let _ = view::with_build_web(html, res_files,  how_handle);
// }


fn main() {
    r_ui::log_init();
    let mut h = with_html! {@li UI
        (T "hello world"),
        (T "hello world"),
        (T "hello world")
        @css
        ul {
            height: 80%;
        }
    };
    let res = r_ui::load_res_files(r#"
    src/template/light.css
    src/template/default.css
    src/template/bootstrap-4/css/bootstrap.min.css
    src/template/base64.min.js
    src/template/jquery.min.js
    src/template/bootstrap-4/js/bootstrap.min.js
    src/template/highlight.js
    src/template/default.js
    "#);
    // r_ui::view::brd_ui_handler("t", move|id, tp, content|{
    //     println!("handle here : {} {} {} ", &tp, &id, &content);
    // });
    r_ui::view::app_with(&h, res,  move |_, _| loop {});
}
